UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jrP3SqilnBoNH9a9cra6VZrnswD2SrdV6VzTNOjrsYc='
WHERE
key_id = '19f720a3e47b4e2b9c800fcd8ca8025a9893dd3b25b967bb342a588ad4a4bade'
AND (
token = 'jrP3SqilnBoNH9a9cra6VZrnswD2SrdV6VzTNOjrsYc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)