UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7LbGuccVPlta44uYMgDJeVlvZ6OsbExt720PgO0oNSs='
WHERE
key_id = 'e1b07caeefc28dc410b0a60c937f6c415a58285275afe7ba64ac4cbb6ad24ba1'
AND (
token = '7LbGuccVPlta44uYMgDJeVlvZ6OsbExt720PgO0oNSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)