UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tb7XIf1V4pObkYkwTJMkKNqC5gJdjeepYd23T0Iwbms='
WHERE
key_id = 'ecb290da88411199ce0a6a35276dc5ffd7db9ed64ec49738c211903665f12aca'
AND (
token = 'tb7XIf1V4pObkYkwTJMkKNqC5gJdjeepYd23T0Iwbms='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)