UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3dEu38Ub5IDlQYp2owSZZYD00F9D8IaFNW8XZxDL2cE='
WHERE
key_id = 'f66f5d9f44e40e39ca3cd307d326e0f35bb5f2aeaffaa1cae00922fb72ef5f44'
AND (
token = '3dEu38Ub5IDlQYp2owSZZYD00F9D8IaFNW8XZxDL2cE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)