UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kmFu80LNIw3fF2E4BcOO7jXfwH0ASPXNzYPIlx/eVO0='
WHERE
key_id = '0762e1c853062ac28be91d2a8fca1d8b0cfd5301998cd500a963f9cf66d51df6'
AND (
token = 'kmFu80LNIw3fF2E4BcOO7jXfwH0ASPXNzYPIlx/eVO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)