UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nj1sxaBj5QzoHcfNyVooVb8yB2lnjjexB1ynBGE0UWk='
WHERE
key_id = '54a67683960c73b926550d90686f876caad721483432daf5607d4f1a79336cbd'
AND (
token = 'nj1sxaBj5QzoHcfNyVooVb8yB2lnjjexB1ynBGE0UWk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)