UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bl34M2QQLAwrLKCf9ORFZmV4/ICNOTVv78hhHanBFR4='
WHERE
key_id = 'd0681396fd315ba6f644ab1502fa6cd6b10ac8908ca799554ae4f302c7ce2fd2'
AND (
token = 'bl34M2QQLAwrLKCf9ORFZmV4/ICNOTVv78hhHanBFR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)