UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'clmelC9MB8HKVR+QH9CM76ax0akHF3flf/PBV9UXvc4='
WHERE
key_id = '2f1b15bed36de63d84cde8a60fd4ecd672b03550bb3bcf2f6d7ad8e1079e7994'
AND (
token = 'clmelC9MB8HKVR+QH9CM76ax0akHF3flf/PBV9UXvc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)