UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gHNRSecMhapi3yYlbKIEv5IKkPFit+1AnBkpbRfc4vc='
WHERE
key_id = 'ef0e8d4bdc9753f30c6afa93fbc52d5351ac9d4edeac382215f4c07c126ad6d5'
AND (
token = 'gHNRSecMhapi3yYlbKIEv5IKkPFit+1AnBkpbRfc4vc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)