UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3UIywAdvt2oaEJktwWDgMZkQ7hRdM/kSkbj9vzpWvO4='
WHERE
key_id = 'a04fa4d1c093369585e68362b74a96bcef37017c2913fc97cf782c4eeef320ff'
AND (
token = '3UIywAdvt2oaEJktwWDgMZkQ7hRdM/kSkbj9vzpWvO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)