UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jD3fhd7jRdzyRE+A+bgX3yOkMRMHwfXraVwC7rkBbdk='
WHERE
key_id = '9b34da9cdcca226f799c2b4dfe49f3ba9ec7ca2dc9b433ac34f8748a07a10c0c'
AND (
token = 'jD3fhd7jRdzyRE+A+bgX3yOkMRMHwfXraVwC7rkBbdk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)