UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+NDDL4259aYjrfuZym5WKoVDbt8cA2agjEqhvL98bP4=' 
WHERE 
  key_id = 'd70d6860aa932bb66b00b8cbbe873d8eb04aa5edab05e1ecb23f049dc2a967ac' 
  AND (
    token = '+NDDL4259aYjrfuZym5WKoVDbt8cA2agjEqhvL98bP4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033