UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v+Zw09UOs7qKPm6yjQNzsYZO9UquGPw9bDX16hsxjYs='
WHERE
key_id = 'ea5d34077e5ca2514c392dbf2541244a0a9535ecfa2058a282a12522b6340a95'
AND (
token = 'v+Zw09UOs7qKPm6yjQNzsYZO9UquGPw9bDX16hsxjYs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)