UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qVSRhGaT1jO3dCBTfjV0KT7Jdqvtdq+JbOL9qQk+Lqs='
WHERE
key_id = '596e00e07584240d3e01fdf193c50c99030bd19c9da65c92c02ba59b14b9cd12'
AND (
token = 'qVSRhGaT1jO3dCBTfjV0KT7Jdqvtdq+JbOL9qQk+Lqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)