UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '08FzN3dYo6c4aNcgoOW5cQ1k1VPNk/fl85m3OAgPfTw='
WHERE
key_id = 'c193ed411d268e3e91c6df6f5f095a92c76195e87400528ed20b8c59f28c9780'
AND (
token = '08FzN3dYo6c4aNcgoOW5cQ1k1VPNk/fl85m3OAgPfTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)