UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rch3a/oSWGdvMIVv1PNfwzfvcxMCQZe/MhhW75Z1lUc=' 
WHERE 
  key_id = '81a97ae2b3e7cff392cc414a20377b5201c27f50a71c24497744f5f9286a5abd' 
  AND (
    token = 'Rch3a/oSWGdvMIVv1PNfwzfvcxMCQZe/MhhW75Z1lUc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030