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