UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+8B+yJilYV3cuzHLY1HTJKpXxUYYHH8GASRPmiXJp8E='
WHERE
key_id = '61e0ea7458f918d28ab5a6fa4ec9231b204e064876c998e3203cba0d1fb6271d'
AND (
token = '+8B+yJilYV3cuzHLY1HTJKpXxUYYHH8GASRPmiXJp8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)