UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IjAcZ3Jmmmm5inOWuv1zEc7v4CdH0NjHGeYNr73hAkE='
WHERE
key_id = '29bc4836a65c44b65b487b48ef7726ed1baec9aaec1401ae9a5e6baeb2cd52fd'
AND (
token = 'IjAcZ3Jmmmm5inOWuv1zEc7v4CdH0NjHGeYNr73hAkE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)