UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5d90qS4xhWfW+PFSlP/KrmqqSzPwmmZilUZuswcei2s=' 
WHERE 
  key_id = '62f1aa22fb56408555adddc2b426abc66c1cb660db476d5e430d4014b7161f16' 
  AND (
    token = '5d90qS4xhWfW+PFSlP/KrmqqSzPwmmZilUZuswcei2s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056