UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DO0ApY6bmSMiuaBmB/wiNkKkVrzblVieGfzTsUdTkI0='
WHERE
key_id = '38f373d686ce2bc15e2c11ab18497fae792d61f5c098dc4c56f5755a1c474db5'
AND (
token = 'DO0ApY6bmSMiuaBmB/wiNkKkVrzblVieGfzTsUdTkI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)