UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g+QG1XtdQMRbRBABDlMxbnxZD8MTA4XzH22vULzUXY4='
WHERE
key_id = 'efac3d32cf609febf4763395259919d950f9c6774b5985280c2c7a928c287f7a'
AND (
token = 'g+QG1XtdQMRbRBABDlMxbnxZD8MTA4XzH22vULzUXY4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)