UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wjklqnr3VaqPUMOaVsT1+QlLpZmg67M2ubkgQB15ePA='
WHERE
key_id = 'c665023e7511aa613b70b91e70ad5f8bb145e161a882134ea54bf2ef059380f5'
AND (
token = 'Wjklqnr3VaqPUMOaVsT1+QlLpZmg67M2ubkgQB15ePA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)