UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VnV/l9aJiJnm2My8t0wYhVWlX3qFUPXriWKilXDu8wg='
WHERE
key_id = '2f27bf3549202fd49fb971eecbed847d825234ebc9afe6cefc25c253b6fd6f7c'
AND (
token = 'VnV/l9aJiJnm2My8t0wYhVWlX3qFUPXriWKilXDu8wg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)