UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '34tzE5grWjtoYRaffxo/g1XWlJvNjXfO8iDa+It9dmY='
WHERE
key_id = '4270dda93ff8be7eb8e868ceb1e95fd0adef60885814f0ffbed378563654ef22'
AND (
token = '34tzE5grWjtoYRaffxo/g1XWlJvNjXfO8iDa+It9dmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)