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

Query time 0.00035