UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pU13P8Dv2PvE4kv9/rQj0D9KgwQVwCfE0D1DZHQTlXs='
WHERE
key_id = 'fedadf7965b086817c0ed9b799202d4e9f5a163f35ea5a26db228dc9056953d7'
AND (
token = 'pU13P8Dv2PvE4kv9/rQj0D9KgwQVwCfE0D1DZHQTlXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)