UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0PC5sbDtZXm3X5Uu1PFIx+xaFvQZ0CssxuuJom9vl6o=' 
WHERE 
  key_id = 'd0b28c382468f1d649e8bfbcaa11dbb185887358fb0869b6706e813dceef2495' 
  AND (
    token = '0PC5sbDtZXm3X5Uu1PFIx+xaFvQZ0CssxuuJom9vl6o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033