UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8RNlVgegTyAZ52FgIqv+aeQt8jibWO5Gv8gYW+LPPtQ=' 
WHERE 
  key_id = '90ef81c4d95910c0dce62db288092144e4ca64a8f1b507bdbc64638c7baead13' 
  AND (
    token = '8RNlVgegTyAZ52FgIqv+aeQt8jibWO5Gv8gYW+LPPtQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033