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