UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Tq/qgJSz3B6Clzq53tlbKHP1o4siHc5aj0bdCYzWV0='
WHERE
key_id = '1e0bc1a754afaa7b782e11b7541e4939218335f0598601395aec6bfe0d5874b4'
AND (
token = '/Tq/qgJSz3B6Clzq53tlbKHP1o4siHc5aj0bdCYzWV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)