UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ClE2uwgYr7rdqq7GFidl1gKmxBorkOlh6wlinm5LiUY='
WHERE
key_id = '098b49cc665ceb93aa1e307942b0fc8580007b761c39d4d3192e14eddc3309d3'
AND (
token = 'ClE2uwgYr7rdqq7GFidl1gKmxBorkOlh6wlinm5LiUY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)