UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jZCw2FekskWtKF9e11XVVSqRiPJw8fOKT6E8/YfBjUY='
WHERE
key_id = 'e3e2e2bf05498bdaf681d261257ce947f1501cfb395e4397bfd09a9eefd6280d'
AND (
token = 'jZCw2FekskWtKF9e11XVVSqRiPJw8fOKT6E8/YfBjUY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)