UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NEXJab+BUcCgbNksb4W0llVB0pjQYxEDhfTCjlRUPdw=' 
WHERE 
  key_id = 'fb19649ce3542806511e12fa498f3d7a5b22dafb23e92c4b1f2e3e6c282b7228' 
  AND (
    token = 'NEXJab+BUcCgbNksb4W0llVB0pjQYxEDhfTCjlRUPdw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028