UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eyxW/kNOyEQSJOznuxaVL+2pVj6yf0ChksIc5vzX4AU='
WHERE
key_id = 'c83476f13ff69d4c22355ca7859aaf8051501f0a2486febedaea92b1a1838a34'
AND (
token = 'eyxW/kNOyEQSJOznuxaVL+2pVj6yf0ChksIc5vzX4AU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)